using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace GameUI {
	public class ButtonImage:MonoBehaviour {
		protected virtual void Start() {
			checker=GetComponentInParent<ButtonChecker>();
		}
		protected virtual void Update() {
			if(checker.pressed!=pressedPrevious) {
				if(checker.pressed) transform.position+=new Vector3(0,-1f/16f);
				else transform.position+=new Vector3(0,1f/16f);
				pressedPrevious=checker.pressed;
			}
		}

		bool pressedPrevious;
		ButtonChecker checker;
	}
}